package edu.upf.Ilusio.Entities;

/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Enumeration;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;

/**
 * Class Picture.
 * 
 * @version $Revision$ $Date$
 */
public class Picture implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _id
     */
    private long _id;

    /**
     * keeps track of state for field: _id
     */
    private boolean _has_id;

    /**
     * Field _name
     */
    private java.lang.String _name;

    /**
     * Field _authorList
     */
    private java.util.ArrayList _authorList;

    /**
     * Field _tagList
     */
    private java.util.ArrayList _tagList;

    /**
     * Field _keywordList
     */
    private java.util.ArrayList _keywordList;

    /**
     * Field _description
     */
    private java.lang.String _description;

    /**
     * Field _date
     */
    private org.exolab.castor.types.Date _date;

    /**
     * Field _latitude
     */
    private float _latitude;

    /**
     * keeps track of state for field: _latitude
     */
    private boolean _has_latitude;

    /**
     * Field _longitude
     */
    private float _longitude;

    /**
     * keeps track of state for field: _longitude
     */
    private boolean _has_longitude;

    /**
     * Field _path
     */
    private java.lang.String _path;

    /**
     * Field _hash
     */
    private java.lang.String _hash;

    /**
     * Field _size
     */
    private double _size;

    /**
     * keeps track of state for field: _size
     */
    private boolean _has_size;

    /**
     * Field _format
     */
    private java.lang.String _format;

    /**
     * Field _areaList
     */
    private java.util.ArrayList _areaList;


      //----------------/
     //- Constructors -/
    //----------------/

    public Picture() 
     {
        super();
        _authorList = new ArrayList();
        _tagList = new ArrayList();
        _keywordList = new ArrayList();
        _areaList = new ArrayList();
    } //-- Picture()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method addArea
     * 
     * 
     * 
     * @param vArea
     */
    public void addArea(Area vArea)
        throws java.lang.IndexOutOfBoundsException
    {
        _areaList.add(vArea);
    } //-- void addArea(Area) 

    /**
     * Method addArea
     * 
     * 
     * 
     * @param index
     * @param vArea
     */
    public void addArea(int index, Area vArea)
        throws java.lang.IndexOutOfBoundsException
    {
        _areaList.add(index, vArea);
    } //-- void addArea(int, Area) 

    /**
     * Method addAuthor
     * 
     * 
     * 
     * @param vAuthor
     */
    public void addAuthor(java.lang.String vAuthor)
        throws java.lang.IndexOutOfBoundsException
    {
        _authorList.add(vAuthor);
    } //-- void addAuthor(java.lang.String) 

    /**
     * Method addAuthor
     * 
     * 
     * 
     * @param index
     * @param vAuthor
     */
    public void addAuthor(int index, java.lang.String vAuthor)
        throws java.lang.IndexOutOfBoundsException
    {
        _authorList.add(index, vAuthor);
    } //-- void addAuthor(int, java.lang.String) 

    /**
     * Method addKeyword
     * 
     * 
     * 
     * @param vKeyword
     */
    public void addKeyword(java.lang.String vKeyword)
        throws java.lang.IndexOutOfBoundsException
    {
        _keywordList.add(vKeyword);
    } //-- void addKeyword(java.lang.String) 

    /**
     * Method addKeyword
     * 
     * 
     * 
     * @param index
     * @param vKeyword
     */
    public void addKeyword(int index, java.lang.String vKeyword)
        throws java.lang.IndexOutOfBoundsException
    {
        _keywordList.add(index, vKeyword);
    } //-- void addKeyword(int, java.lang.String) 

    /**
     * Method addTag
     * 
     * 
     * 
     * @param vTag
     */
    public void addTag(java.lang.String vTag)
        throws java.lang.IndexOutOfBoundsException
    {
        _tagList.add(vTag);
    } //-- void addTag(java.lang.String) 

    /**
     * Method addTag
     * 
     * 
     * 
     * @param index
     * @param vTag
     */
    public void addTag(int index, java.lang.String vTag)
        throws java.lang.IndexOutOfBoundsException
    {
        _tagList.add(index, vTag);
    } //-- void addTag(int, java.lang.String) 

    /**
     * Method clearArea
     * 
     */
    public void clearArea()
    {
        _areaList.clear();
    } //-- void clearArea() 

    /**
     * Method clearAuthor
     * 
     */
    public void clearAuthor()
    {
        _authorList.clear();
    } //-- void clearAuthor() 

    /**
     * Method clearKeyword
     * 
     */
    public void clearKeyword()
    {
        _keywordList.clear();
    } //-- void clearKeyword() 

    /**
     * Method clearTag
     * 
     */
    public void clearTag()
    {
        _tagList.clear();
    } //-- void clearTag() 

    /**
     * Method deleteId
     * 
     */
    public void deleteId()
    {
        this._has_id= false;
    } //-- void deleteId() 

    /**
     * Method deleteLatitude
     * 
     */
    public void deleteLatitude()
    {
        this._has_latitude= false;
    } //-- void deleteLatitude() 

    /**
     * Method deleteLongitude
     * 
     */
    public void deleteLongitude()
    {
        this._has_longitude= false;
    } //-- void deleteLongitude() 

    /**
     * Method deleteSize
     * 
     */
    public void deleteSize()
    {
        this._has_size= false;
    } //-- void deleteSize() 

    /**
     * Method enumerateArea
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateArea()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_areaList.iterator());
    } //-- java.util.Enumeration enumerateArea() 

    /**
     * Method enumerateAuthor
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateAuthor()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_authorList.iterator());
    } //-- java.util.Enumeration enumerateAuthor() 

    /**
     * Method enumerateKeyword
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateKeyword()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_keywordList.iterator());
    } //-- java.util.Enumeration enumerateKeyword() 

    /**
     * Method enumerateTag
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateTag()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_tagList.iterator());
    } //-- java.util.Enumeration enumerateTag() 

    /**
     * Method getArea
     * 
     * 
     * 
     * @param index
     * @return Area
     */
    public Area getArea(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _areaList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (Area) _areaList.get(index);
    } //-- Area getArea(int) 

    /**
     * Method getArea
     * 
     * 
     * 
     * @return Area
     */
    public Area[] getArea()
    {
        int size = _areaList.size();
        Area[] mArray = new Area[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (Area) _areaList.get(index);
        }
        return mArray;
    } //-- Area[] getArea() 

    /**
     * Method getAreaCount
     * 
     * 
     * 
     * @return int
     */
    public int getAreaCount()
    {
        return _areaList.size();
    } //-- int getAreaCount() 

    /**
     * Method getAuthor
     * 
     * 
     * 
     * @param index
     * @return String
     */
    public java.lang.String getAuthor(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _authorList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (String)_authorList.get(index);
    } //-- java.lang.String getAuthor(int) 

    /**
     * Method getAuthor
     * 
     * 
     * 
     * @return String
     */
    public java.lang.String[] getAuthor()
    {
        int size = _authorList.size();
        java.lang.String[] mArray = new java.lang.String[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (String)_authorList.get(index);
        }
        return mArray;
    } //-- java.lang.String[] getAuthor() 

    /**
     * Method getAuthorCount
     * 
     * 
     * 
     * @return int
     */
    public int getAuthorCount()
    {
        return _authorList.size();
    } //-- int getAuthorCount() 

    /**
     * Returns the value of field 'date'.
     * 
     * @return Date
     * @return the value of field 'date'.
     */
    public org.exolab.castor.types.Date getDate()
    {
        return this._date;
    } //-- org.exolab.castor.types.Date getDate() 

    /**
     * Returns the value of field 'description'.
     * 
     * @return String
     * @return the value of field 'description'.
     */
    public java.lang.String getDescription()
    {
        return this._description;
    } //-- java.lang.String getDescription() 

    /**
     * Returns the value of field 'format'.
     * 
     * @return String
     * @return the value of field 'format'.
     */
    public java.lang.String getFormat()
    {
        return this._format;
    } //-- java.lang.String getFormat() 

    /**
     * Returns the value of field 'hash'.
     * 
     * @return String
     * @return the value of field 'hash'.
     */
    public java.lang.String getHash()
    {
        return this._hash;
    } //-- java.lang.String getHash() 

    /**
     * Returns the value of field 'id'.
     * 
     * @return long
     * @return the value of field 'id'.
     */
    public long getId()
    {
        return this._id;
    } //-- long getId() 

    /**
     * Method getKeyword
     * 
     * 
     * 
     * @param index
     * @return String
     */
    public java.lang.String getKeyword(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _keywordList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (String)_keywordList.get(index);
    } //-- java.lang.String getKeyword(int) 

    /**
     * Method getKeyword
     * 
     * 
     * 
     * @return String
     */
    public java.lang.String[] getKeyword()
    {
        int size = _keywordList.size();
        java.lang.String[] mArray = new java.lang.String[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (String)_keywordList.get(index);
        }
        return mArray;
    } //-- java.lang.String[] getKeyword() 

    /**
     * Method getKeywordCount
     * 
     * 
     * 
     * @return int
     */
    public int getKeywordCount()
    {
        return _keywordList.size();
    } //-- int getKeywordCount() 

    /**
     * Returns the value of field 'latitude'.
     * 
     * @return float
     * @return the value of field 'latitude'.
     */
    public float getLatitude()
    {
        return this._latitude;
    } //-- float getLatitude() 

    /**
     * Returns the value of field 'longitude'.
     * 
     * @return float
     * @return the value of field 'longitude'.
     */
    public float getLongitude()
    {
        return this._longitude;
    } //-- float getLongitude() 

    /**
     * Returns the value of field 'name'.
     * 
     * @return String
     * @return the value of field 'name'.
     */
    public java.lang.String getName()
    {
        return this._name;
    } //-- java.lang.String getName() 

    /**
     * Returns the value of field 'path'.
     * 
     * @return String
     * @return the value of field 'path'.
     */
    public java.lang.String getPath()
    {
        return this._path;
    } //-- java.lang.String getPath() 

    /**
     * Returns the value of field 'size'.
     * 
     * @return double
     * @return the value of field 'size'.
     */
    public double getSize()
    {
        return this._size;
    } //-- double getSize() 

    /**
     * Method getTag
     * 
     * 
     * 
     * @param index
     * @return String
     */
    public java.lang.String getTag(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _tagList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (String)_tagList.get(index);
    } //-- java.lang.String getTag(int) 

    /**
     * Method getTag
     * 
     * 
     * 
     * @return String
     */
    public java.lang.String[] getTag()
    {
        int size = _tagList.size();
        java.lang.String[] mArray = new java.lang.String[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (String)_tagList.get(index);
        }
        return mArray;
    } //-- java.lang.String[] getTag() 

    /**
     * Method getTagCount
     * 
     * 
     * 
     * @return int
     */
    public int getTagCount()
    {
        return _tagList.size();
    } //-- int getTagCount() 

    /**
     * Method hasId
     * 
     * 
     * 
     * @return boolean
     */
    public boolean hasId()
    {
        return this._has_id;
    } //-- boolean hasId() 

    /**
     * Method hasLatitude
     * 
     * 
     * 
     * @return boolean
     */
    public boolean hasLatitude()
    {
        return this._has_latitude;
    } //-- boolean hasLatitude() 

    /**
     * Method hasLongitude
     * 
     * 
     * 
     * @return boolean
     */
    public boolean hasLongitude()
    {
        return this._has_longitude;
    } //-- boolean hasLongitude() 

    /**
     * Method hasSize
     * 
     * 
     * 
     * @return boolean
     */
    public boolean hasSize()
    {
        return this._has_size;
    } //-- boolean hasSize() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return boolean
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param out
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method removeArea
     * 
     * 
     * 
     * @param vArea
     * @return boolean
     */
    public boolean removeArea(Area vArea)
    {
        boolean removed = _areaList.remove(vArea);
        return removed;
    } //-- boolean removeArea(Area) 

    /**
     * Method removeAuthor
     * 
     * 
     * 
     * @param vAuthor
     * @return boolean
     */
    public boolean removeAuthor(java.lang.String vAuthor)
    {
        boolean removed = _authorList.remove(vAuthor);
        return removed;
    } //-- boolean removeAuthor(java.lang.String) 

    /**
     * Method removeKeyword
     * 
     * 
     * 
     * @param vKeyword
     * @return boolean
     */
    public boolean removeKeyword(java.lang.String vKeyword)
    {
        boolean removed = _keywordList.remove(vKeyword);
        return removed;
    } //-- boolean removeKeyword(java.lang.String) 

    /**
     * Method removeTag
     * 
     * 
     * 
     * @param vTag
     * @return boolean
     */
    public boolean removeTag(java.lang.String vTag)
    {
        boolean removed = _tagList.remove(vTag);
        return removed;
    } //-- boolean removeTag(java.lang.String) 

    /**
     * Method setArea
     * 
     * 
     * 
     * @param index
     * @param vArea
     */
    public void setArea(int index, Area vArea)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _areaList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _areaList.set(index, vArea);
    } //-- void setArea(int, Area) 

    /**
     * Method setArea
     * 
     * 
     * 
     * @param areaArray
     */
    public void setArea(Area[] areaArray)
    {
        //-- copy array
        _areaList.clear();
        for (int i = 0; i < areaArray.length; i++) {
            _areaList.add(areaArray[i]);
        }
    } //-- void setArea(Area) 

    /**
     * Method setAuthor
     * 
     * 
     * 
     * @param index
     * @param vAuthor
     */
    public void setAuthor(int index, java.lang.String vAuthor)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _authorList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _authorList.set(index, vAuthor);
    } //-- void setAuthor(int, java.lang.String) 

    /**
     * Method setAuthor
     * 
     * 
     * 
     * @param authorArray
     */
    public void setAuthor(java.lang.String[] authorArray)
    {
        //-- copy array
        _authorList.clear();
        for (int i = 0; i < authorArray.length; i++) {
            _authorList.add(authorArray[i]);
        }
    } //-- void setAuthor(java.lang.String) 

    /**
     * Sets the value of field 'date'.
     * 
     * @param date the value of field 'date'.
     */
    public void setDate(org.exolab.castor.types.Date date)
    {
        this._date = date;
    } //-- void setDate(org.exolab.castor.types.Date) 

    /**
     * Sets the value of field 'description'.
     * 
     * @param description the value of field 'description'.
     */
    public void setDescription(java.lang.String description)
    {
        this._description = description;
    } //-- void setDescription(java.lang.String) 

    /**
     * Sets the value of field 'format'.
     * 
     * @param format the value of field 'format'.
     */
    public void setFormat(java.lang.String format)
    {
        this._format = format;
    } //-- void setFormat(java.lang.String) 

    /**
     * Sets the value of field 'hash'.
     * 
     * @param hash the value of field 'hash'.
     */
    public void setHash(java.lang.String hash)
    {
        this._hash = hash;
    } //-- void setHash(java.lang.String) 

    /**
     * Sets the value of field 'id'.
     * 
     * @param id the value of field 'id'.
     */
    public void setId(long id)
    {
        this._id = id;
        this._has_id = true;
    } //-- void setId(long) 

    /**
     * Method setKeyword
     * 
     * 
     * 
     * @param index
     * @param vKeyword
     */
    public void setKeyword(int index, java.lang.String vKeyword)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _keywordList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _keywordList.set(index, vKeyword);
    } //-- void setKeyword(int, java.lang.String) 

    /**
     * Method setKeyword
     * 
     * 
     * 
     * @param keywordArray
     */
    public void setKeyword(java.lang.String[] keywordArray)
    {
        //-- copy array
        _keywordList.clear();
        for (int i = 0; i < keywordArray.length; i++) {
            _keywordList.add(keywordArray[i]);
        }
    } //-- void setKeyword(java.lang.String) 

    /**
     * Sets the value of field 'latitude'.
     * 
     * @param latitude the value of field 'latitude'.
     */
    public void setLatitude(float latitude)
    {
        this._latitude = latitude;
        this._has_latitude = true;
    } //-- void setLatitude(float) 

    /**
     * Sets the value of field 'longitude'.
     * 
     * @param longitude the value of field 'longitude'.
     */
    public void setLongitude(float longitude)
    {
        this._longitude = longitude;
        this._has_longitude = true;
    } //-- void setLongitude(float) 

    /**
     * Sets the value of field 'name'.
     * 
     * @param name the value of field 'name'.
     */
    public void setName(java.lang.String name)
    {
        this._name = name;
    } //-- void setName(java.lang.String) 

    /**
     * Sets the value of field 'path'.
     * 
     * @param path the value of field 'path'.
     */
    public void setPath(java.lang.String path)
    {
        this._path = path;
    } //-- void setPath(java.lang.String) 

    /**
     * Sets the value of field 'size'.
     * 
     * @param size the value of field 'size'.
     */
    public void setSize(double size)
    {
        this._size = size;
        this._has_size = true;
    } //-- void setSize(double) 

    /**
     * Method setTag
     * 
     * 
     * 
     * @param index
     * @param vTag
     */
    public void setTag(int index, java.lang.String vTag)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _tagList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _tagList.set(index, vTag);
    } //-- void setTag(int, java.lang.String) 

    /**
     * Method setTag
     * 
     * 
     * 
     * @param tagArray
     */
    public void setTag(java.lang.String[] tagArray)
    {
        //-- copy array
        _tagList.clear();
        for (int i = 0; i < tagArray.length; i++) {
            _tagList.add(tagArray[i]);
        }
    } //-- void setTag(java.lang.String) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (Picture) Unmarshaller.unmarshal(Picture.class, reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     * 
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
